<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="">添加物流动态</a></li>
        <!--<li><a href="{:url('AdminPage/add')}">添加页面</a></li>-->
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('Transit/add_logistics')}">
        订单号:
        <?php if(isset($order_id)){?>
        <input type="text" name="flag" style="width: 200px;"
               value="1" hidden>
        <input type="text" class="form-control" name="order_id" style="width: 200px;"
               value="{$order_id|default=''}"  readonly>
        <?php }else{?>
        <input type="text" class="form-control" name="order_id" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入订单号" >
        <?php }?>
        时间:
        <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
               value="{$start_time|default=''}"
               style="width: 140px;" autocomplete="off">
        到达地点:
        <input type="text" class="form-control" name="place" style="width: 150px;"
               value="" placeholder="中文">
        <input type="text" class="form-control" name="placeEnglish" style="width: 150px;"
               value="" placeholder="英文">
        剩余距离:
        <input type="number" class="form-control" name="distance" style="width: 150px;"
               value="" placeholder="以km为单位">
        备注信息:
        <input type="text" class="form-control" name="remark" style="width: 200px;"
               value="" placeholder="中文">
        <input type="text" class="form-control" name="remarkEnglish" style="width: 200px;"
               value="" placeholder="英文">
        <button class="btn btn-primary" id="add">添加</button>

    </form>
    <foreach name="logistics" item="v">
        <tr>
            <td>
                {$v.start_time}
            </td>
            <td >
               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                {$v.place}({$v.placeEnglish})
            </td>
            <td >
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                {$v.distance}km
            </td>
            <td >
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                {$v.remark}({$v.remarkEnglish})
            </td>
        </tr></br></br></br>
    </foreach>
</div>
<script src="__STATIC__/js/admin.js">
</script>
<script>
    $(function(){
        $('#add').click(function(){
            if($("input[name='order_id']").val()==''){
                alert('请填写订单号');
                return false;
            }
            if($("input[name='start_time']").val()==''){
                alert('请填写物流动态时间');
                return false;
            }
            if($("input[name='place']").val()==''){
                alert('请填写到达地点');
                return false;
            }
            if($("input[name='placeEnglish']").val()==''){
                alert('请填写到达地点(中文)');
                return false;
            }
            if($("input[name='distance']").val()==''){
                alert('请填写剩余距离');
                return false;
            }
            if($("input[name='remark']").val()==''){
                alert('请填写备注信息');
                return false;
            }
            if($("input[name='remarkEnglish']").val()==''){
                alert('请填写备注信息（英文）');
                return false;
            }
        });
    });
</script>

</body>
</html>